{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import os\n",
    "import json\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "from sklearn.linear_model import LogisticRegression, RidgeCV\n",
    "from scipy.stats import ks_2samp\n",
    "\n",
    "from matplotlib import pyplot as plt\n",
    "import seaborn as sns\n",
    "%matplotlib inline\n",
    "flag = pd.read_csv('flag.csv', index_col='sample_id')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "File b'cy_credoox_blacklist.txt' does not exist",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-9-c874717cb607>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mblacklist\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_csv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'cy_credoox_blacklist.txt'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindex_col\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'cy_credoox_blacklist.sample_id'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msep\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'\\t'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      2\u001b[0m \u001b[0mblacklist\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolumns\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mvar\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msplit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'.'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mvar\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mblacklist\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      3\u001b[0m \u001b[0mblacklist\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mblacklist\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mblacklist\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msource_id\u001b[0m\u001b[0;34m==\u001b[0m\u001b[0;34m'A'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      4\u001b[0m \u001b[0mblacklist\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      5\u001b[0m \u001b[0mblacklist\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhead\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/caijian271/anaconda/lib/python3.6/site-packages/pandas/io/parsers.py\u001b[0m in \u001b[0;36mparser_f\u001b[0;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, skip_footer, doublequote, delim_whitespace, as_recarray, compact_ints, use_unsigned, low_memory, buffer_lines, memory_map, float_precision)\u001b[0m\n\u001b[1;32m    644\u001b[0m                     skip_blank_lines=skip_blank_lines)\n\u001b[1;32m    645\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 646\u001b[0;31m         \u001b[0;32mreturn\u001b[0m \u001b[0m_read\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    647\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    648\u001b[0m     \u001b[0mparser_f\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__name__\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/caijian271/anaconda/lib/python3.6/site-packages/pandas/io/parsers.py\u001b[0m in \u001b[0;36m_read\u001b[0;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[1;32m    387\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    388\u001b[0m     \u001b[0;31m# Create the parser.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 389\u001b[0;31m     \u001b[0mparser\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mTextFileReader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    390\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    391\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mnrows\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mchunksize\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/caijian271/anaconda/lib/python3.6/site-packages/pandas/io/parsers.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[1;32m    728\u001b[0m             \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0moptions\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'has_index_names'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'has_index_names'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    729\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 730\u001b[0;31m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_make_engine\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mengine\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    731\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    732\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0mclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/caijian271/anaconda/lib/python3.6/site-packages/pandas/io/parsers.py\u001b[0m in \u001b[0;36m_make_engine\u001b[0;34m(self, engine)\u001b[0m\n\u001b[1;32m    921\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0m_make_engine\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mengine\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'c'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    922\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mengine\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'c'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 923\u001b[0;31m             \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_engine\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mCParserWrapper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0moptions\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    924\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    925\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mengine\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'python'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/caijian271/anaconda/lib/python3.6/site-packages/pandas/io/parsers.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, src, **kwds)\u001b[0m\n\u001b[1;32m   1388\u001b[0m         \u001b[0mkwds\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'allow_leading_cols'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex_col\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1389\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1390\u001b[0;31m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_reader\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_parser\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTextReader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msrc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1391\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1392\u001b[0m         \u001b[0;31m# XXX\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32mpandas/parser.pyx\u001b[0m in \u001b[0;36mpandas.parser.TextReader.__cinit__ (pandas/parser.c:4184)\u001b[0;34m()\u001b[0m\n",
      "\u001b[0;32mpandas/parser.pyx\u001b[0m in \u001b[0;36mpandas.parser.TextReader._setup_parser_source (pandas/parser.c:8449)\u001b[0;34m()\u001b[0m\n",
      "\u001b[0;31mFileNotFoundError\u001b[0m: File b'cy_credoox_blacklist.txt' does not exist"
     ]
    }
   ],
   "source": [
    "blacklist = pd.read_csv('cy_credoox_blacklist.txt', index_col='cy_credoox_blacklist.sample_id', sep='\\t')\n",
    "blacklist.columns = [var.split('.')[1] for var in blacklist.columns]\n",
    "blacklist = blacklist[blacklist.source_id=='A']\n",
    "blacklist.shape\n",
    "blacklist.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "def plot_N_var(df, var, missing_impute=None, qs=None):\n",
    "    y = df['flag'].values\n",
    "    y_T, n_T = float(np.sum(y)), float(len(y))\n",
    "    \n",
    "    if var not in df.columns:\n",
    "        raise Exception(\"The variable is not found in the data.\")\n",
    "    \n",
    "    fig, ax = plt.subplots(1,3)\n",
    "\n",
    "    if missing_impute is None:\n",
    "        x = pd.to_numeric(df[var], errors='coerce').values\n",
    "    else:\n",
    "        x = pd.to_numeric(df[var], errors='coerce').fillna(missing_impute).values\n",
    "\n",
    "    #Plot 1: distribution\n",
    "    sns.distplot(x[pd.notnull(x)], kde=False, ax=ax[0])\n",
    "    \n",
    "    #Plot 2: Factor plot\n",
    "    if qs is None:\n",
    "        quantiles = list(set([-np.inf] + \\\n",
    "                             list(np.percentile(x[pd.notnull(x)], [float(i) * 10.0 for i in range(10)])) + \\\n",
    "                             [np.inf]))\n",
    "        quantiles.sort()\n",
    "        #print quantiles\n",
    "    else:\n",
    "        quantiles = qs\n",
    "\n",
    "    #print quantiles\n",
    "    bins = pd.cut(x, quantiles, include_lowest=False)\n",
    "    \n",
    "    if missing_impute is None:\n",
    "        bins = bins.set_categories([\"missing\"] + list(bins.categories)).fillna('missing')\n",
    "\n",
    "    print(bins.categories)\n",
    "\n",
    "    tmp_df = pd.DataFrame({'bins': bins, 'flag': y})\n",
    "    sns.factorplot(x=\"bins\", y=\"flag\", data=tmp_df,\n",
    "                   kind=\"bar\", palette=\"muted\", ax=ax[1])\n",
    "    \n",
    "    #Plot 3: WOE\n",
    "    vi_table = pd.concat((tmp_df.groupby('bins').sum(),\n",
    "                      tmp_df.groupby('bins').count()),\n",
    "                     axis=1\n",
    "                    )\n",
    "    vi_table.columns=['response', 'total']\n",
    "    vi_table['woe'] = np.log(vi_table.response/vi_table.total/(y_T/n_T))\n",
    "    vi_table['vi'] = (vi_table.response / y_T - vi_table.total / n_T) * vi_table['woe']\n",
    "    vi_table['vi'][vi_table['vi']==np.inf] = 0\n",
    "    iv = vi_table.vi.sum()\n",
    "    print(\"IV of\", var, \":\", iv )\n",
    "    vi_table['bins'] = vi_table.index\n",
    "    sns.factorplot(x='bins', y='woe', data=vi_table,\n",
    "                   kind=\"bar\", palette=\"muted\", ax=ax[2])\n",
    "    \n",
    "    woe_mapper = {}\n",
    "    for val, w in zip(vi_table.bins.values, vi_table.woe.values):\n",
    "        woe_mapper[val] = w\n",
    "    \n",
    "    #plt.show()\n",
    "    return quantiles, iv, woe_mapper, fig"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'blacklist' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-7-f88c1a195c9e>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m blacklist_var1 = blacklist.groupby(by=blacklist.index,\n\u001b[0m\u001b[1;32m      2\u001b[0m                                    sort=False)['month_black_listed'].min()\n",
      "\u001b[0;31mNameError\u001b[0m: name 'blacklist' is not defined"
     ]
    }
   ],
   "source": [
    "blacklist_var1 = blacklist.groupby(by=blacklist.index,\n",
    "                                   sort=False)['month_black_listed'].min()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "blacklist_var1 = pd.merge(flag, pd.DataFrame(blacklist_var1), how='left', left_index=True, right_index=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'blacklist_var1' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-4-552a7de53d8a>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mplot_N_var\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mblacklist_var1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'month_black_listed'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mqs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m6\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m12\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minf\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'blacklist_var1' is not defined"
     ]
    }
   ],
   "source": [
    "plot_N_var(blacklist_var1, 'month_black_listed', qs=[-np.inf, 3, 6, 12, np.inf])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>flag</th>\n",
       "      <th>risk_score</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sample_id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>4b948fea-8853-48d8-93f8-972e9b940b20</th>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3da426c5-452e-49f7-8f02-5a448c848d79</th>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8ecd788b-896c-4b12-b16a-2ede7969b9d1</th>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1d819eb0-d590-4906-901d-626e51265518</th>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cbfac0bd-3d96-4089-a142-7fe37f22affc</th>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                      flag  risk_score\n",
       "sample_id                                             \n",
       "4b948fea-8853-48d8-93f8-972e9b940b20     0         NaN\n",
       "3da426c5-452e-49f7-8f02-5a448c848d79     0         NaN\n",
       "8ecd788b-896c-4b12-b16a-2ede7969b9d1     0         NaN\n",
       "1d819eb0-d590-4906-901d-626e51265518     1         NaN\n",
       "cbfac0bd-3d96-4089-a142-7fe37f22affc     0         NaN"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "blacklist_var2 = blacklist.groupby(by=blacklist.index,\n",
    "                                   sort=False)['risk_score'].max().apply(lambda x: int(x)/10)\n",
    "blacklist_var2 = pd.merge(flag, pd.DataFrame(blacklist_var2), how='left', left_index=True, right_index=True)\n",
    "blacklist_var2.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Index([u'missing', u'(-inf, 2]', u'(2, inf]'], dtype='object')\n",
      "IV of risk_score : 0.0493959796412\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda2\\lib\\site-packages\\ipykernel\\__main__.py:46: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "([-inf, 2, inf],\n",
       " 0.049395979641223116,\n",
       " {'(-inf, 2]': 0.46419908948656635,\n",
       "  '(2, inf]': 0.76714924855119837,\n",
       "  'missing': -0.073648120060737232},\n",
       " <matplotlib.figure.Figure at 0x2851cba8>)"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAERCAYAAABy/XBZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt8FPW5+PHPJiHB3CBAROQqYB7wAqhoBCEQpa31rqet\nl1pFtCpVWmvt0Vit59haqRZt1VNRuWjr5dh62vqrVJSqGEgVsRbD9SFI8VKhIAlsks2V7O+PmQ2b\nsLlvdhPmeb9evNyZ+c7MM3438+zMfOf79QWDQYwxxnhPQrwDMMYYEx+WAIwxxqMsARhjjEdZAjDG\nGI+yBGCMMR5lCcAYYzwqqbWFIpIELAFGAcnAfcAm4GmgAdigqje5Zb8NXA/UAfep6jIR6Qs8CxwJ\n+IGrVXWviJwO/NItu0JV743+oZmuEBEf8GtgIlANXKeq28OWnw/cjVOHS1V1kYgkA0uB0cB+4CZV\n/SjmwZsOa0d9fxO4FajHqe+FcQnURFVbVwBXAl+oah5wNvAY8BBwp6rOABJE5EIRGQzMA6a45e4X\nkT7AXKDYXf+3OCcMgMeBy1R1Op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RlgCMMcajLAEY\n0woRmeG2024+/4N4xGOix+rWEoAx7XFIUzlVPTkegZio83Td9sQ3gY3pabJF5FVgKM6bmjcD1aqa\n4PZQORQ4FqeDssVuz5Qn4rzqn4jzNvY1qvpRfMI3rfB03doVgDFtG4XT38sEnI7vbqTpL8cTgVk4\nvT3e4fbF9H3gF6p6GvCou8z0PKPwcN1aAjCmbYWqut39/Dwws9nyt1T1gNu9717cfmyA/xGRRTh9\n0jwfq2BNh3i6bi0BGNO28GH4fBw68EfzgTx8qvp/OF1wr8HpqO+J7gvPdIGn69YSgDFtmy4iw8QZ\nh/lqYEVbK4jI/wK57mAdd9OFcSVMt/J03VoCMKZtG3AG//4Qp8OxJa2UDd0//hlwp4j8Hadzr+93\na4Smszxdt9YZnDHGeJRdARhjjEdZAjDGGI+yBGCMMR5lCcAYYzzKEoAxxniUJQBjjPEoSwDGGONR\nlgCMMcaj/j+hTELmJqIvdwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2851cba8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARkAAAEZCAYAAACjEFEXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADjlJREFUeJzt3W+MHAd5gPHnDrcmMuckwLZUrQiEP69QMRYQN45lJyZN\n+oE4rSHigwERHNyEUFIaR0g4UhUJqTRtiiVIa5HELX+qhFYKdSO1YLVUiUpMcakrUYPo6zimEpWI\ncrWEzyWxifH2w+yh9eHbu3Pvnd07Pb9Pnpm78auT9/HM7szcWLfbRZKqjA97AEnLm5GRVMrISCpl\nZCSVMjKSShkZSaXKIxMRV0bE4+dZf2NE/GtEHIiIHdVzSBqO0shExEeBh4CVM9avAHYD1wGbgVsj\nolM5i6ThqD6SOQq84zzr3wA8lZlTmfkC8CRwdfEskoagNDKZuQ84c55Nq4ETfcsngYsrZ5E0HCuG\n9PdO0YR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Ht0s4bmDun1wMciYjVwJ/Anmflr\nwP29bVpGjIwW0z/3PfXtEZqHGvV7PDN/0nv0xXGaRwT8PfBnEbGX5klrj7Q1rNphZLSY+m/sG6OJ\nRr+ZD+say8wvAW8GDgK/x2g9JEuLwMhoMW2KiF/pPZTpZuAf5/qGiPgr4MrMfIjmubFvLp5RLTMy\nWkzfBv6C5pGS3+/9eTbT79V8Arg7Ig7RPO926I9n0OLyUQ+SSnkkI6mUkZFUyshIKmVkJJUyMpJK\nGRlJpYyMpFL/B/QgKQzb39roAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a3e4d30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARkAAAEZCAYAAACjEFEXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADjhJREFUeJzt3W2MHIV5wPH/uScc5JxxElZJ1KqkEeRRpIBLMMW2zGtM\nPwSQnET54BIV3LqhUKIkjpBipIoKqRENjZsEgYJxXpq0UKmkViRIrBYJt2Bat6VS6kbk4cVfqqpR\nTpaw3VI7GLYfZi9aX3x7e9Y9s3un/++LPTt3c49O3r9ndmdmJ7rdLpJUZcWoB5C0vBkZSaWMjKRS\nRkZSKSMjqZSRkVSqPDIRcUVEPH2Gx2+KiH+OiAMRsb16DkmjURqZiLgLeARYOevxSWAXsBm4Bvhk\nRHQqZ5E0GtV7Mi8DHznD4+8HXsrMY5n5OvAscFXxLJJGoDQymbkXOHWGVauBo33Lx4HzKmeRNBqT\nI/q5x2hCM2MKeHW+b+p2u92JiYmyoSTNa8FPwLYiM3uwF4ALI2IN8BrNodL9825kYoLp6eMF49Xp\ndKacuQXO3I5OZ2rB39NWZLoAEbEVWJWZeyJiB/C3NAHak5n/3dIsklo0scSuwu4uxfI7cz1nbken\nM7XgwyVPxpNUyshIKmVkJJUyMpJKGRlJpYyMpFJGRlIpIyOplJG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PZea1mi8Ad0fE8zT3ux357Rm0uLzVg6RS7slIKmVkJJUyMpJKGRlJpYyMpFJG\nRlIpIyOp1P8DUnYmOrxzsWIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2855acc0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_N_var(blacklist_var2, 'risk_score', qs=[-np.inf, 2, np.inf])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(79343, 10)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id_type</th>\n",
       "      <th>id_no</th>\n",
       "      <th>reason_no</th>\n",
       "      <th>org_code</th>\n",
       "      <th>auth_code</th>\n",
       "      <th>industry_code</th>\n",
       "      <th>date_created</th>\n",
       "      <th>date_updated</th>\n",
       "      <th>org_number</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cy_credoox_loanee.sample_id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>925b6df3-bab7-41f2-9119-5a3bbfaf2103</th>\n",
       "      <td>张锐</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>10000008</td>\n",
       "      <td>MCL0023XX</td>\n",
       "      <td>MCL</td>\n",
       "      <td>2015-11-30</td>\n",
       "      <td>2015-11-30</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52486865-41d8-4403-b68d-cc42c50459ce</th>\n",
       "      <td>满世琪</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>10000008</td>\n",
       "      <td>MCL0023XX</td>\n",
       "      <td>MCL</td>\n",
       "      <td>2015-12-16</td>\n",
       "      <td>2015-12-16</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6b9a42e7-ca1d-4c13-b0b2-2d2a98725ed6</th>\n",
       "      <td>石建毅</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>055854273</td>\n",
       "      <td>P2P1603XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-03-29</td>\n",
       "      <td>2016-03-29</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>dd4430ce-42c7-4bfc-8401-3b77a281735f</th>\n",
       "      <td>杨启昆</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>56037830-0</td>\n",
       "      <td>MCL0463XX</td>\n",
       "      <td>MCL</td>\n",
       "      <td>2016-01-12</td>\n",
       "      <td>2016-01-12</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9cf4e61d-6138-4eb1-abbe-c4fec49ebe81</th>\n",
       "      <td>丁洋</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>05786068-5</td>\n",
       "      <td>ASM0043XX</td>\n",
       "      <td>ASM</td>\n",
       "      <td>2016-01-08</td>\n",
       "      <td>2016-01-08</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     name  id_type               id_no  \\\n",
       "cy_credoox_loanee.sample_id                                              \n",
       "925b6df3-bab7-41f2-9119-5a3bbfaf2103   张锐        0  ******************   \n",
       "52486865-41d8-4403-b68d-cc42c50459ce  满世琪        0  ******************   \n",
       "6b9a42e7-ca1d-4c13-b0b2-2d2a98725ed6  石建毅        0  ******************   \n",
       "dd4430ce-42c7-4bfc-8401-3b77a281735f  杨启昆        0  ******************   \n",
       "9cf4e61d-6138-4eb1-abbe-c4fec49ebe81   丁洋        0  ******************   \n",
       "\n",
       "                                      reason_no    org_code  auth_code  \\\n",
       "cy_credoox_loanee.sample_id                                              \n",
       "925b6df3-bab7-41f2-9119-5a3bbfaf2103          1    10000008  MCL0023XX   \n",
       "52486865-41d8-4403-b68d-cc42c50459ce          1    10000008  MCL0023XX   \n",
       "6b9a42e7-ca1d-4c13-b0b2-2d2a98725ed6          1   055854273  P2P1603XX   \n",
       "dd4430ce-42c7-4bfc-8401-3b77a281735f          1  56037830-0  MCL0463XX   \n",
       "9cf4e61d-6138-4eb1-abbe-c4fec49ebe81          1  05786068-5  ASM0043XX   \n",
       "\n",
       "                                     industry_code date_created date_updated  \\\n",
       "cy_credoox_loanee.sample_id                                                    \n",
       "925b6df3-bab7-41f2-9119-5a3bbfaf2103           MCL   2015-11-30   2015-11-30   \n",
       "52486865-41d8-4403-b68d-cc42c50459ce           MCL   2015-12-16   2015-12-16   \n",
       "6b9a42e7-ca1d-4c13-b0b2-2d2a98725ed6           P2P   2016-03-29   2016-03-29   \n",
       "dd4430ce-42c7-4bfc-8401-3b77a281735f           MCL   2016-01-12   2016-01-12   \n",
       "9cf4e61d-6138-4eb1-abbe-c4fec49ebe81           ASM   2016-01-08   2016-01-08   \n",
       "\n",
       "                                      org_number  \n",
       "cy_credoox_loanee.sample_id                       \n",
       "925b6df3-bab7-41f2-9119-5a3bbfaf2103           1  \n",
       "52486865-41d8-4403-b68d-cc42c50459ce           1  \n",
       "6b9a42e7-ca1d-4c13-b0b2-2d2a98725ed6           3  \n",
       "dd4430ce-42c7-4bfc-8401-3b77a281735f           7  \n",
       "9cf4e61d-6138-4eb1-abbe-c4fec49ebe81           1  "
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "loanee = pd.read_csv('cy_credoox_loanee.txt', index_col='cy_credoox_loanee.sample_id', sep='\\t')\n",
    "loanee.columns = [var.split('.')[1] for var in loanee.columns]\n",
    "print loanee.shape\n",
    "loanee.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id_type</th>\n",
       "      <th>id_no</th>\n",
       "      <th>reason_no</th>\n",
       "      <th>org_code</th>\n",
       "      <th>auth_code</th>\n",
       "      <th>industry_code</th>\n",
       "      <th>date_created</th>\n",
       "      <th>date_updated</th>\n",
       "      <th>org_number</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cy_credoox_loanee.sample_id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>915000003458894159</td>\n",
       "      <td>CNS0073XX</td>\n",
       "      <td>CNS</td>\n",
       "      <td>2016-04-21</td>\n",
       "      <td>2016-04-21</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>31167565-4</td>\n",
       "      <td>P2P1073XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-03-18</td>\n",
       "      <td>2016-03-18</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>09998467-8</td>\n",
       "      <td>MCL0213XX</td>\n",
       "      <td>MCL</td>\n",
       "      <td>2016-04-20</td>\n",
       "      <td>2016-04-20</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>P2P0021034</td>\n",
       "      <td>P2P0333XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-04-13</td>\n",
       "      <td>2016-04-13</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>09358278-2</td>\n",
       "      <td>P2P1333XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2015-11-25</td>\n",
       "      <td>2015-11-25</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>09188010-2</td>\n",
       "      <td>P2P1133XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-03-21</td>\n",
       "      <td>2016-03-21</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>09188010-2</td>\n",
       "      <td>P2P1133XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2015-12-12</td>\n",
       "      <td>2015-12-12</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>P2P0021034</td>\n",
       "      <td>P2P0333XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-02-29</td>\n",
       "      <td>2016-02-29</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>NET00215124</td>\n",
       "      <td>P2P0243XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-04-22</td>\n",
       "      <td>2016-04-22</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>91310000MA1K32252J</td>\n",
       "      <td>P2P2353XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-04-25</td>\n",
       "      <td>2016-04-25</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>09188010-2</td>\n",
       "      <td>P2P1133XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2015-11-05</td>\n",
       "      <td>2015-11-05</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>09188010-2</td>\n",
       "      <td>P2P1133XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-04-21</td>\n",
       "      <td>2016-04-21</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>10000001</td>\n",
       "      <td>P2P0023XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2015-09-25</td>\n",
       "      <td>2015-09-25</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>P2P0021034</td>\n",
       "      <td>P2P0333XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2015-09-04</td>\n",
       "      <td>2015-09-04</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>P2P0021034</td>\n",
       "      <td>P2P0333XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-01-26</td>\n",
       "      <td>2016-01-26</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>3</td>\n",
       "      <td>IVT00210134</td>\n",
       "      <td>MCL0073XX</td>\n",
       "      <td>MCL</td>\n",
       "      <td>2015-09-25</td>\n",
       "      <td>2015-09-25</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>310113000793600</td>\n",
       "      <td>P2P0223XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-04-02</td>\n",
       "      <td>2016-04-02</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>P2P0021034</td>\n",
       "      <td>P2P0333XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2015-10-08</td>\n",
       "      <td>2015-10-08</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>10000001</td>\n",
       "      <td>P2P0023XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2015-08-13</td>\n",
       "      <td>2015-08-13</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>FIN00253457</td>\n",
       "      <td>P2P0553XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-04-18</td>\n",
       "      <td>2016-04-18</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>34233815-9</td>\n",
       "      <td>P2P2623XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-04-18</td>\n",
       "      <td>2016-04-18</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>41000000201511060058</td>\n",
       "      <td>MCL0613XX</td>\n",
       "      <td>MCL</td>\n",
       "      <td>2016-04-14</td>\n",
       "      <td>2016-04-14</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>P2P0021034</td>\n",
       "      <td>P2P0333XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-03-30</td>\n",
       "      <td>2016-03-30</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>07479813-1</td>\n",
       "      <td>P2P1373XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-03-10</td>\n",
       "      <td>2016-03-10</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>P2P0021034</td>\n",
       "      <td>P2P0333XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2015-12-03</td>\n",
       "      <td>2015-12-03</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>NET00215124</td>\n",
       "      <td>P2P0243XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-03-31</td>\n",
       "      <td>2016-03-31</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>IVT00102456</td>\n",
       "      <td>MCL0083XX</td>\n",
       "      <td>MCL</td>\n",
       "      <td>2016-03-10</td>\n",
       "      <td>2016-03-10</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c16b5dc8-e723-403a-a385-779b8f3968de</th>\n",
       "      <td>袁安平</td>\n",
       "      <td>0</td>\n",
       "      <td>******************</td>\n",
       "      <td>1</td>\n",
       "      <td>FIN07553694</td>\n",
       "      <td>P2P0183XX</td>\n",
       "      <td>P2P</td>\n",
       "      <td>2016-04-04</td>\n",
       "      <td>2016-04-04</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     name  id_type               id_no  \\\n",
       "cy_credoox_loanee.sample_id                                              \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  袁安平        0  ******************   \n",
       "\n",
       "                                      reason_no              org_code  \\\n",
       "cy_credoox_loanee.sample_id                                             \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1    915000003458894159   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            31167565-4   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            09998467-8   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            P2P0021034   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            09358278-2   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            09188010-2   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            09188010-2   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            P2P0021034   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1           NET00215124   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1    91310000MA1K32252J   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            09188010-2   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            09188010-2   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1              10000001   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            P2P0021034   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            P2P0021034   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          3           IVT00210134   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1       310113000793600   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            P2P0021034   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1              10000001   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1           FIN00253457   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            34233815-9   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1  41000000201511060058   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            P2P0021034   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            07479813-1   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1            P2P0021034   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1           NET00215124   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1           IVT00102456   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de          1           FIN07553694   \n",
       "\n",
       "                                      auth_code industry_code date_created  \\\n",
       "cy_credoox_loanee.sample_id                                                  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  CNS0073XX           CNS   2016-04-21   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P1073XX           P2P   2016-03-18   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  MCL0213XX           MCL   2016-04-20   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0333XX           P2P   2016-04-13   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P1333XX           P2P   2015-11-25   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P1133XX           P2P   2016-03-21   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P1133XX           P2P   2015-12-12   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0333XX           P2P   2016-02-29   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0243XX           P2P   2016-04-22   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P2353XX           P2P   2016-04-25   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P1133XX           P2P   2015-11-05   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P1133XX           P2P   2016-04-21   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0023XX           P2P   2015-09-25   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0333XX           P2P   2015-09-04   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0333XX           P2P   2016-01-26   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  MCL0073XX           MCL   2015-09-25   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0223XX           P2P   2016-04-02   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0333XX           P2P   2015-10-08   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0023XX           P2P   2015-08-13   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0553XX           P2P   2016-04-18   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P2623XX           P2P   2016-04-18   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  MCL0613XX           MCL   2016-04-14   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0333XX           P2P   2016-03-30   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P1373XX           P2P   2016-03-10   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0333XX           P2P   2015-12-03   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0243XX           P2P   2016-03-31   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  MCL0083XX           MCL   2016-03-10   \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de  P2P0183XX           P2P   2016-04-04   \n",
       "\n",
       "                                     date_updated  org_number  \n",
       "cy_credoox_loanee.sample_id                                    \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-21          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-03-18          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-20          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-13          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2015-11-25          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-03-21          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2015-12-12          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-02-29          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-22          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-25          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2015-11-05          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-21          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2015-09-25          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2015-09-04          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-01-26          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2015-09-25          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-02          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2015-10-08          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2015-08-13          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-18          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-18          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-14          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-03-30          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-03-10          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2015-12-03          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-03-31          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-03-10          20  \n",
       "c16b5dc8-e723-403a-a385-779b8f3968de   2016-04-04          20  "
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_df = loanee.groupby(loanee.index).count()\n",
    "tmp_df[tmp_df.id_no==28]\n",
    "loanee[loanee.index=='c16b5dc8-e723-403a-a385-779b8f3968de']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
